﻿<Window x:Class="RehostingSimple.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:validation="clr-namespace:System.Activities.Presentation.Validation;assembly=System.Activities.Presentation"
        mc:Ignorable="d"
        xmlns:wf="clr-namespace:RehostingLib;assembly=RehostingLib"
        d:DataContext="{d:DesignInstance Type=wf:DesignerViewModel,IsDesignTimeCreatable=True}"
        Title="MainWindow" Height="700" Width="1000" WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <Style TargetType="GridSplitter" x:Key="HorizontalSplitterStyle">
            <Setter Property="VerticalAlignment" Value="Stretch"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="Width" Value="5"/>
        </Style>
        
        <Style TargetType="TextBlock">
            <Setter Property="Margin" Value="5"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="250"/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="250"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <ContentPresenter Content="{Binding Path=ToolBoxView}" Grid.RowSpan="2" />
        <ContentPresenter Content="{Binding Path=DesignerView}" Grid.Column="2" />
        <TabControl Grid.Column="4" HorizontalAlignment="Stretch" Grid.RowSpan="2">
            <TabItem Header="Properties">
                <ContentPresenter Content="{Binding Path=PropertyView}"  />
            </TabItem>
            <TabItem Header="Outline">
                <ContentPresenter Content="{Binding Path=OutlineView}"  />
            </TabItem>
        </TabControl>

        <ListView Grid.Column="2" Grid.Row="1" ItemsSource="{Binding Path=Errors}" MaxHeight="250">
            <ListView.ItemTemplate>
                <DataTemplate DataType="{x:Type validation:ValidationErrorInfo}">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Path=Id}" FontWeight="Bold"/>
                        <TextBlock Text="{Binding Path=PropertyName}" FontWeight="Bold"/>
                        <TextBlock Text="{Binding Path=Message}" Margin="5,0"/>
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

        <GridSplitter Style="{StaticResource HorizontalSplitterStyle}" Grid.Column="1" Grid.RowSpan="2"/>
        <GridSplitter Style="{StaticResource HorizontalSplitterStyle}" Grid.Column="3" Grid.RowSpan="2"/>

    </Grid>
</Window>
